home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-06  |  4.8 KB  |  183 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __EPPC__
  21. #define __EPPC__
  22.  
  23.  
  24. #ifndef __ERRORS__
  25. #include <Errors.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __APPLETALK__
  30. #include <AppleTalk.h>
  31. #endif
  32. /*    #include <Types.h>                                            */
  33. /*    #include <OSUtils.h>                                        */
  34. /*        #include <MixedMode.h>                                    */
  35. /*        #include <Memory.h>                                        */
  36.  
  37. #ifndef __FILES__
  38. #include <Files.h>
  39. #endif
  40. /*    #include <Finder.h>                                            */
  41.  
  42. #ifndef __PPCTOOLBOX__
  43. #include <PPCToolbox.h>
  44. #endif
  45.  
  46. #ifndef __PROCESSES__
  47. #include <Processes.h>
  48. #endif
  49. /*    #include <Events.h>                                            */
  50. /*        #include <Quickdraw.h>                                    */
  51. /*            #include <QuickdrawText.h>                            */
  52.  
  53. #ifndef __EVENTS__
  54. #include <Events.h>
  55. #endif
  56.  
  57. #ifdef __cplusplus
  58. extern "C" {
  59. #endif
  60.  
  61. #if PRAGMA_ALIGN_SUPPORTED
  62. #pragma options align=mac68k
  63. #endif
  64.  
  65. #if PRAGMA_IMPORT_SUPPORTED
  66. #pragma import on
  67. #endif
  68.  
  69.  
  70. enum {
  71. /* value for eventRecord.what */
  72.     kHighLevelEvent                = 23
  73. };
  74.  
  75. enum {
  76. /* postOptions currently supported */
  77.     receiverIDMask                = 0x0000F000,
  78.     receiverIDisPSN                = 0x00008000,
  79.     receiverIDisSignature        = 0x00007000,
  80.     receiverIDisSessionID        = 0x00006000,
  81.     receiverIDisTargetID        = 0x00005000,
  82.     systemOptionsMask            = 0x00000F00,
  83.     nReturnReceipt                = 0x00000200,
  84.     priorityMask                = 0x000000FF,
  85.     nAttnMsg                    = 0x00000001
  86. };
  87.  
  88. enum {
  89. /* constant for return receipts */
  90.     HighLevelEventMsgClass        = 'jaym',
  91.     rtrnReceiptMsgID            = 'rtrn'
  92. };
  93.  
  94. enum {
  95.     msgWasPartiallyAccepted        = 2,
  96.     msgWasFullyAccepted            = 1,
  97.     msgWasNotAccepted            = 0
  98. };
  99.  
  100. struct TargetID {
  101.     long                            sessionID;
  102.     PPCPortRec                        name;
  103.     LocationNameRec                    location;
  104.     PPCPortRec                        recvrName;
  105. };
  106. typedef struct TargetID TargetID;
  107.  
  108. typedef TargetID *TargetIDPtr, **TargetIDHandle, **TargetIDHdl;
  109.  
  110. typedef TargetID SenderID;
  111.  
  112. typedef SenderID *SenderIDPtr;
  113.  
  114. struct HighLevelEventMsg {
  115.     unsigned short                    HighLevelEventMsgHeaderLength;
  116.     unsigned short                    version;
  117.     unsigned long                    reserved1;
  118.     EventRecord                        theMsgEvent;
  119.     unsigned long                    userRefcon;
  120.     unsigned long                    postingOptions;
  121.     unsigned long                    msgLength;
  122. };
  123. typedef struct HighLevelEventMsg HighLevelEventMsg;
  124.  
  125. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHandle, **HighLevelEventMsgHdl;
  126.  
  127. typedef pascal Boolean (*GetSpecificFilterProcPtr)(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  128.  
  129. #if GENERATINGCFM
  130. typedef UniversalProcPtr GetSpecificFilterUPP;
  131. #else
  132. typedef GetSpecificFilterProcPtr GetSpecificFilterUPP;
  133. #endif
  134.  
  135. enum {
  136.     uppGetSpecificFilterProcInfo = kPascalStackBased
  137.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  138.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  139.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(HighLevelEventMsgPtr)))
  140.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TargetID*)))
  141. };
  142.  
  143. #if GENERATINGCFM
  144. #define NewGetSpecificFilterProc(userRoutine)        \
  145.         (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  146. #else
  147. #define NewGetSpecificFilterProc(userRoutine)        \
  148.         ((GetSpecificFilterUPP) (userRoutine))
  149. #endif
  150.  
  151. #if GENERATINGCFM
  152. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)        \
  153.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  154. #else
  155. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)        \
  156.         (*(userRoutine))((contextPtr), (msgBuff), (sender))
  157. #endif
  158.  
  159. extern pascal OSErr PostHighLevelEvent(const EventRecord *theEvent, unsigned long receiverID, unsigned long msgRefcon, void *msgBuff, unsigned long msgLen, unsigned long postingOptions)
  160.  THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  161. extern pascal OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, void *msgBuff, unsigned long *msgLen)
  162.  THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  163. extern pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortRec *portName, ProcessSerialNumber *pPSN)
  164.  THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  165. extern pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortRec *portName, const ProcessSerialNumber *pPSN)
  166.  THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  167. extern pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *contextPtr, OSErr *err)
  168.  THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  169.  
  170. #if PRAGMA_IMPORT_SUPPORTED
  171. #pragma import off
  172. #endif
  173.  
  174. #if PRAGMA_ALIGN_SUPPORTED
  175. #pragma options align=reset
  176. #endif
  177.  
  178. #ifdef __cplusplus
  179. }
  180. #endif
  181.  
  182. #endif /* __EPPC__ */
  183.